Emacs syntax highlighting and file-type detection#942
Conversation
| (defconst ql--at-type-regex "\\_<@\\w+\\>") | ||
| (defconst ql--predicate-regex "\\(\\_<\\w+\\(\\+\\|\\*\\)?\\_>\\)\\s-*(") | ||
| (defconst ql--primitive-type-regex (regexp-opt '("int" "string" "float" "boolean" "date") 'symbols)) | ||
| (defconst ql--annotation-regex (regexp-opt '("abstract" "cached" "external" "final" "transient" "library" "private" "deprecated" "override" "query" "language" "bindingset") 'words)) |
There was a problem hiding this comment.
It probably makes sense to keep this consistent with the vim list. This list additionally has transient, while vim has:
monotonicAggregates
noinline
nomagic
noopt
pragma
There was a problem hiding this comment.
Fair, I have changed it such that we now highlight all arguments to the parameterized annotations pragma, language and bindingset. In that way, we do not have to update the highlightning rules when new pragmas or languages are introduced.
| (defconst ql--predicate-regex "\\(\\_<\\w+\\(\\+\\|\\*\\)?\\_>\\)\\s-*(") | ||
| (defconst ql--primitive-type-regex (regexp-opt '("int" "string" "float" "boolean" "date") 'symbols)) | ||
| (defconst ql--annotation-regex (regexp-opt '("abstract" "cached" "external" "final" "transient" "library" "private" "deprecated" "override" "query") 'words)) | ||
| (defconst ql--parameterized-annotation-regex "\\<\\(pragma\\|language\\|bindingset\\) *\\[ *[a-z, ]*\\]") |
There was a problem hiding this comment.
I think that a-z should also allow uppercase for monotonicAggregate to work.
It's slightly unfortunate that bindingset[this] and bindingset[result] are not highlighted correctly, although I'm not sure how important you feel that is.
There was a problem hiding this comment.
Great, this looks good to me locally.

Emacs support similar to the Vim support. Relevant for Make syntax highlightning configs public.
I emphasize that this is a simple Emacs mode, and that we have much more advanced, but untable, mode internally.
Ping @rneatherway as another Emacs person.